Template.messages_search_list_item.helpers({
  info: function() {
    return Template.instance().data.friend.info;
  },
  getEmail: function() {
    return Template.instance().data.friend.info.emails[0].address;
  },
  loading: function() {
    return !Template.instance().resultSub.ready();
  }
});

Template.messages_search_list_item.events({
  'click .messages-search-link'(event, instance) {
    Session.set('class.messages.chatroomFriendId', instance.data.friend.friend_id);
    Session.set('class.messages.modalContent', 'messages_chatroom');
  }
});